package com.demo4;

public abstract class Pet {
    private String name;
    private int health;
    private int love;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getHealth() {
        return health;
    }

    public void setHealth(int health) {
        this.health = health;
    }

    public int getLove() {
        return love;
    }

    public void setLove(int love) {
        this.love = love;
    }
    //抽象方法:只有方法声明，没有{}实现
    //一个类中只要有一个抽象方法，这个类一定要声明为抽象类
    public abstract void toHospital();

}
